<!DOCTYPE html>
<html lang="en" ng-app="cms">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
		<title>Document</title>
		<link rel="stylesheet" type="text/css" href="./css/mui.css">
		<script type="text/javascript" src="js/angular.js" ></script>
		<script src="js/angular/controller.js"></script>
	</head>
	<style>
		.floatright{
			float: right;
		}
	</style>
	<body>
		<header class="mui-bar mui-bar-nav" ng-controller="pubNews">
			<h1 class="mui-title">NEWS</h1>
			<div ng-if="role=='9'">
				<div class="mui-icon mui-icon-paperplane floatright" ng-click="pubInfo(role)"></div>
			</div> 
		</header>
		<nav class="mui-bar mui-bar-tab">
			<a class="mui-tab-item mui-active" id="tab1">
				<span class="mui-icon mui-icon-home"></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item" id="tab2">
				<span class="mui-icon mui-icon-email"></span>
				<span class="mui-tab-label">消息</span>
			</a>
			<a class="mui-tab-item" id="tab3">
				<span class="mui-icon mui-icon-contact"></span>
				<span class="mui-tab-label">通讯录</span>
			</a>
			<a class="mui-tab-item" id="tab4">
				<span class="mui-icon mui-icon-gear"></span>
				<span class="mui-tab-label">我的</span>
			</a>
		</nav>
		<script type="text/javascript" src="./js/mui.js"></script>
		<script type="text/javascript">
			(function($) {
				$.init({
					subpages: [{
						url: 'tab1.html',
						id: 'tab1',
						styles: {
							top: '45px', //mui标题栏默认高度为45px；
							bottom: '50px' //默认为0px，可不定义；
						}
					}],
					preloadPages: [{
						url: 'tab2.html',
						id: 'tab2',
						styles: {
							top: '0px', //mui标题栏默认高度为45px；
							bottom: '50px' //默认为0px，可不定义；
						}
					}, {
						url: 'tab3.html',
						id: 'tab3',
						styles: {
							top: '0px', //mui标题栏默认高度为45px；
							bottom: '50px' //默认为0px，可不定义；
						}
					}, {
						url: 'tab4.html',
						id: 'tab4',
						styles: {
							top: '0px', //mui标题栏默认高度为45px；
							bottom: '50px' //默认为0px，可不定义；
						}
					}],
					preloadLimit: 5
				});
				$.plusReady(function() {
					$.page_nav = function() {
							navs = document.querySelectorAll(".mui-tab-item");
							for(var i = 0; i < navs.length; i++) {
								var obj = navs[i].id;
								(function(s) {
									document.getElementById(s).addEventListener("tap", function() {
										if(s == 'tab1') {
											var main = plus.webview.currentWebview();
											main.reload(true);
											mui.openWindow({
												"id": main.id
											});
										} else {
											$.openWindow({
												"id": new Date(),
												"crateNew": false,
												"url": s + '.html',
												"styles": {
													top: '0px', //mui标题栏默认高度为45px
													bottom: '50px' //默认为0px，可不定义
												}
											});
										}
									}, false);
								})(obj);

							}
						}
						//底部导航菜单绑定
					$.page_nav();
				});
			})(mui)
		</script>
	</body>

</html>